home *** CD-ROM | disk | FTP | other *** search
- --------------------------------------------------------------------------------
- -- Weapon Apple
- -- Original Carnage Contest Weapon
- -- Script by DC, September 2009, www.UnrealSoftware.de
- --------------------------------------------------------------------------------
-
- -- Setup Tables
- if cc==nil then cc={} end
- cc.apple={}
-
- -- Load & Prepare Ressources
- cc.apple.gfx_wpn=loadgfx("weapons/apple.bmp") -- Weapon Image
- setmidhandle(cc.apple.gfx_wpn)
- cc.apple.sfx_eat=loadsfx("eat.ogg") -- Eat Sound
-
- --------------------------------------------------------------------------------
- -- Weapon: Apple
- --------------------------------------------------------------------------------
-
- cc.apple.id=addweapon("cc.apple","Apple",cc.apple.gfx_wpn,0,0) -- Add Weapon (0 uses)
-
- function cc.apple.draw() -- Draw
- if (weapon_shots==0) then
- setblend(blend_alpha)
- setalpha(1)
- setcolor(255,255,255)
- drawinhand(cc.apple.gfx_wpn,8,2,0.6)
- end
- end
-
- function cc.apple.attack(attack) -- Attack
- if (weapon_shots<=0) then
- if (attack==1) then
- -- Use weapon and allow to use another one afterwards (1)
- useweapon(1)
- weapon_shots=weapon_shots+1
- -- Heal
- playerheal(0,15)
- -- Effect
- playsound(cc.apple.sfx_eat)
- end
- end
- end